#include "Bot.h"

CBot::CBot(Player* enemy, string name, int x, int y) : Player(name, x, y)
{
    m_Enemy = enemy;
}

CBot::~CBot(void)
{
}

void CBot::DoAction()
{
    Player::DoAction();

    TGDKSprite* spr = GetMainSprite();
    if (rand()%10 == 5)
    {
        Turn((rand()%10 >5)? 3:-3);
    }else if (rand()%50 == 5){
        Turn(0);
    }
    if (rand()%10 == 5)
    {
        Move(4);
    }else if (rand()%50 == 5)
    {
        Move(0);
    }

    Fire();

    if (spr->GetY()<-10)
    {
        spr->SetAngle(180);
    }else if (spr->GetY()>480)
    {
        spr->SetAngle(0);        
    }
    if (spr->GetX() < -10)
    {
        spr->SetAngle(90);
    }else if (spr->GetX() > 640)
    {
        spr->SetAngle(270);
    }

}
